
<% @person = Person.find(entity) %>

 <% form_tag :action => 'update_phones', :id => entity do %>
<table class="list">
	<tr>
		<th>Number</th>
		<th>Primary?</th>
		<th>Type</th>
		<th>Carrier:</th>
		<th>Comments</th>
	</tr>
<% for @phone in @person.phones %>
   <%= error_messages_for :phone %>
   <% fields_for "phone[]" do |f| %>
<tr class=<%= cycle("even", "odd") %>>
	<td><%= f.text_field :number %></td>
	<td><%= f.check_box :primary %></td>
	<td><%= f.select( :comm_type_id, CommType.find(:all).collect {|p| [p.name, p.id]}, {}) %></td>
	<td><%= f.select( :sms_setup_id, SmsSetup.find(:all).collect {|p| [p.carrier_name, p.id]},options = {:include_blank => true}) %></td>
	<td><%= f.text_field :comments %></td>
	<td><%= link_to 'X', :action => 'delete_phone', :id => @phone, :person => @person %></td>
</tr>
   <% end %>
 <% end %>
<tr>
	<td><%= submit_tag 'Update' %> | <%= link_to "Cancel", :action => 'show', :id => @person %></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
</table>  
 <% end %>



